<!DOCTYPE html>
<html lang="zh-CN" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head th:include="/common/inc::header"/>
<body>
<form class="layui-form" style="margin-top: 15px">
    <div class="layui-form-item">
        <label class="layui-form-label" style="width: 60px">事件类型:</label>
        <div class="layui-input-inline">
            <select name="dressType" id="logType" lay-filter="logType">
                <option value="">全部</option>
                <option value="1">登录</option>
                <option value="2">登出</option>
                <option value="3">新增</option>
                <option value="4">修改</option>
                <option value="5">删除</option>
                <option value="6">导入</option>
            </select>
        </div>
        <label class="layui-form-label" style="width: 100px">操作人:</label>
        <div class="layui-input-inline">
            <input type="text" name="managerName" id="managerName" autocomplete="off"
                   class="layui-input">
        </div>
        <label class="layui-form-label" style="width: 100px">关键词:</label>
        <div class="layui-input-inline">
            <input type="text" name="logRemark" id="logRemark" autocomplete="off"
                   class="layui-input">
        </div>
        <button class="layui-btn" id="searchBtn" lay-submit lay-filter="searchBtn">查询</button>
    </div>
</form>
<table class="layui-table" id="grid" lay-filter="grid">
</table>
<script th:replace="/common/inc::incJs"></script>
<style type="text/css">
    .layui-table-header {
        width: 745px;
    }
</style>
<script>
    var allStr;

    $(function () {
        var tableIns = createTable({
            url: 'opList',
            cols: [[
                {field: 'logRemark', title: '事件名称', width: 200}, {
                    field: 'logType',
                    title: '事件类型',
                    width: 160,
                    templet: '#typeTpl'
                }, {field: 'managerName', title: '操作人', width: 200}
                , {
                    field: 'createTime',
                    title: '事件时间',
                    width: 180
                }
            ]]
        });


        layui.form.on('submit(searchBtn)', function (data) {
            tableIns.reload({
                where: data.field
            });
            return false;
        });
    })
</script>
<script type="text/html" id="typeTpl">
    {{#  if(d.logType ===1){ }}
    <span>登录</span>
    {{#  } else if(d.logType ===2){ }}
    <span>登出</span>
    {{#  } else if(d.logType ===3){ }}
    <span>新增</span>
    {{#  } else if(d.logType ===4){ }}
    <span>修改</span>
    {{#  } else if(d.logType ===5){ }}
    <span>删除</span>
    {{#  } else if(d.logType ===6){ }}
    <span>导入</span>
    {{#  } }}
</script>
</body>
</html>
